#include "stdinclude.h"

#include "platform/dllEntry.h"


BOOL WINAPI DllMain(
  __in  HINSTANCE hinstDLL,
  __in  DWORD fdwReason,
  __in  LPVOID lpvReserved
)


{
	_dbgout("DllMain(0x%x,%d,0x%x) \n", hinstDLL,fdwReason,lpvReserved);
	
	// Perform actions based on the reason for calling.
	switch( fdwReason ) 
	{ 
		case DLL_PROCESS_ATTACH:
		 // Initialize once for each new process.
		 // Return FALSE to fail DLL load.
		
			#ifdef _DEBUG
				#ifndef VLD
					//tell me in Debug Output when I leak memory
					_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
					//_CrtSetBreakAlloc(251);
				#endif
			#endif

			//dllProcessLoad
			dllProcessLoad();

			break;

		case DLL_THREAD_ATTACH:
		 // Do thread-specific initialization.
			break;

		case DLL_THREAD_DETACH:
		 // Do thread-specific cleanup.
			break;

		case DLL_PROCESS_DETACH:
		 // Perform any necessary cleanup.

			dllProcessUnload();

			break;
	}
	return TRUE;  // Successful DLL_PROCESS_ATTACH.
}
